home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / SoundClass.h < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.8 KB  |  64 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 12/21/92
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TSound is a simple object that plays sounds     
  9.   TSound.h contains the TSound class definitions. 
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // Declare label for this header file
  13. #ifndef _SOUND_
  14. #define _SOUND_
  15.  
  16. #ifndef _DTSCPLUSLIBRARY_
  17. #include "DTSCPlusLibrary.h"
  18. #endif
  19.  
  20. #ifndef __RESOURCES__
  21. #include <Resources.h>
  22. #endif
  23.  
  24. #ifndef __SOUND__
  25. #include <Sound.h>
  26. #endif
  27.  
  28. const OSType kSoundType = 'snd ';                // our resource type definition
  29.  
  30.  
  31. // _________________________________________________________________________________________________________ //
  32. //    TSound Class Interface.
  33.  
  34. class TSound
  35. // A simple sound class used for playing sounds synchonously (in future asynch as well).
  36. {
  37. public:
  38.     // CONSTRUCTORS AND DESTRUCTORS
  39.     TSound(char* name);                            // construct an object based on the name of the sound resource
  40.     TSound(short resID);                        // construct an object based on the resource ID
  41.     virtual~ TSound();                            // default destructor
  42.  
  43.     // MAIN INTERFACE
  44.     virtual void Play();                        // play the sound
  45.  
  46.     // FIELDS
  47.     Handle fSoundHandle;                        // handle where the sound resource is stored
  48.     OSErr fError;                                // latest error
  49.     char* fSound;                                // name of the sound wave
  50.     short fSoundID;                                // ID of the sound wave
  51. };
  52.  
  53.  
  54. #endif
  55.  
  56. // _________________________________________________________________________________________________________ //
  57.  
  58.  
  59. /*    Change History (most recent last):
  60.   No        Init.    Date        Comment
  61.   1            khs        12/21/92    New file
  62.   2            khs        1/14/93        Cleanup
  63. */
  64.